/**
 * Created by Administrator on 2017/4/15 0015.
 */
'use strict';

angular.module('App')
    .factory('loadService',['$http','$timeout',function ($http,$timeout) {
        console.log(8)
        return {//正在加载中
            load:function (massage,status) {
                var a = $('<div class="loading-box"></div>');
                var b = $('<div></div>');
                var c = $('<img class="change" src="/assets/images/load.png"/>');
                var d = $('<p></p>').text(massage);
                //console.log(8);
                a.append(b);
                b.append(c);
                b.append(d);
                $('body').append(a);
                if( status == 1 ){
                    $timeout(function() {
                        a.remove();
                    },2000)
                }

            },

            closeLoading:function(){
                $('.loading-box').remove();
            }
        }

        }]);